const state = () => ({
  word: 'helloWorld'
})
// getters
const getters = {}

// actions
const actions = {
  setWord({ commit, state }, val) {
    commit(SETWORD, val)
  },
  setMainState({ commit, state, rootState }) {
    commit('app/SETAPPLOADING', !rootState.app.appLoading, { root: true })
  }
}

// mutations
const mutations = {
  SETWORD(state, data) {
    state.word = data
  }
}

export default {
  // 暂时取得和文件名一致，不然 vue-devtool 会报错，貌似是bug
  // 所以暂时取名取得复杂一点，避免模块重名
  storeName: 'hello',
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
